package edu.sctu.fengleilin.month06.day150605;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by user09 on 2015/6/5.
 */
public class DateTime {
    public static void main(String[] args){
        try {
            System.out.print(dayDist("2015-6-1-7-12"));
        } catch (Exception ex) {
        }
    }

    public static int dayDist(String dateStr) throws Exception{
        SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd-hh-mm");
        Date date=df.parse(dateStr);
        long timeMillion=new Date().getTime()-date.getTime();
        return (int)(timeMillion/(24l*60*60*1000));
    }
}
